// string standard header -*-c++-*-
// Copyright 2009-2010 IAR Systems AB.
#ifndef _STRING_
#define _STRING_

#ifndef _SYSTEM_BUILD
#pragma system_include
#endif

#include <istream>
_STD_BEGIN

// string OPERATORS
inline string operator+(const string& _Left, const string& _Right)
{       // return string + string
  return (string(_Left) += _Right);
}

inline string operator+(const char *_Left, const string& _Right)
{       // return NTBS + string
  return (string(_Left) += _Right);
}

inline string operator+(const char _Left, const string& _Right)
{       // return char + string
  return (string(1, _Left) += _Right);
}

inline string operator+(const string& _Left, const char *_Right)
{       // return string + NTBS
  return (string(_Left) += _Right);
}

inline string operator+(const string& _Left, const char _Right)
{       // return string + char
  return (string(_Left) += _Right);
}

inline bool operator==(const string& _Left, const string& _Right)
{       // test for string equality
  return (_Left.compare(_Right) == 0);
}

inline bool operator==(const char * _Left, const string& _Right)
{       // test for NTBS vs. string equality
  return (_Right.compare(_Left) == 0);
}

inline bool operator==(const string& _Left, const char *_Right)
{       // test for string vs. NTBS equality
  return (_Left.compare(_Right) == 0);
}

inline bool operator!=(const string& _Left, const string& _Right)
{       // test for string inequality
  return (!(_Left == _Right));
}

inline bool operator!=(const char *_Left, const string& _Right)
{       // test for NTBS vs. string inequality
  return (!(_Left == _Right));
}

inline bool operator!=(const string& _Left, const char *_Right)
{       // test for string vs. NTBS inequality
  return (!(_Left == _Right));
}

inline bool operator<(const string& _Left, const string& _Right)
{       // test if string < string
  return (_Left.compare(_Right) < 0);
}

inline bool operator<(const char * _Left, const string& _Right)
{       // test if NTBS < string
  return (_Right.compare(_Left) > 0);
}

inline bool operator<(const string& _Left, const char *_Right)
{       // test if string < NTBS
  return (_Left.compare(_Right) < 0);
}

inline bool operator>(const string& _Left, const string& _Right)
{       // test if string > string
  return (_Right < _Left);
}

inline bool operator>(const char * _Left, const string& _Right)
{       // test if NTBS > string
  return (_Right < _Left);
}

inline bool operator>(const string& _Left, const char *_Right)
{       // test if string > NTBS
  return (_Right < _Left);
}

inline bool operator<=(const string& _Left, const string& _Right)
{       // test if string <= string
  return (!(_Right < _Left));
}

inline bool operator<=(const char * _Left, const string& _Right)
{       // test if NTBS <= string
  return (!(_Right < _Left));
}

inline bool operator<=(const string& _Left, const char *_Right)
{       // test if string <= NTBS
  return (!(_Right < _Left));
}

inline bool operator>=(const string& _Left, const string& _Right)
{       // test if string >= string
  return (!(_Left < _Right));
}

inline bool operator>=(const char * _Left, const string& _Right)
{       // test if NTBS >= string
  return (!(_Left < _Right));
}

inline bool operator>=(const string& _Left, const char *_Right)
{       // test if string >= NTBS
  return (!(_Left < _Right));
}

// string INSERTERS AND EXTRACTORS
istream& operator>>(istream& _Istr, string& _Str);

istream& getline(istream& _Istr, string& _Str,
                 const char _Delim = '\n');

ostream& operator<<(ostream& _Ostr, const string& _Str);

_STD_END
#endif /* _STRING */

/*
 * Copyright (c) 1992-2009 by P.J. Plauger.  ALL RIGHTS RESERVED.
 * Consult your license regarding permissions and restrictions.
 V5.04:0576 */
